<?php
/**
 *  +----------------------------------------------------------------------
 *  | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 *  +----------------------------------------------------------------------
 *  | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
 *  +----------------------------------------------------------------------
 *  | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 *  +----------------------------------------------------------------------
 *  | Author: CRMEB Team <admin@crmeb.com>
 *  +----------------------------------------------------------------------
 */

/**
 * 队伍
 * @author crud自动生成代码
 * @date 2025/09/28 00:10:01
 */

namespace app\model\crud;


use crmeb\basic\BaseModel;

/**
 * Class Team
 * @date 2025/09/28
 * @package app\model\crud
 */
class Team extends BaseModel
{

    /**
     * 表名
     * @var string
     */
    protected $name = 'team';

    /**
     * 主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 关联队长报名信息
     * @return \think\model\relation\BelongsTo
     */
    public function adminBaoming()
    {
        return $this->belongsTo(\app\model\crud\Baoming::class, 'admin_uid', 'uid');
    }

    /**
     * 大学搜索器
     * @param $query
     * @param $value
     */
    public function searchUniversityAttr($query, $value)
    {
        if (!empty($value)) {
            $query->where('university', 'like', '%' . $value . '%');
        }
    }

}
